home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tpdb314.zip / PACK.PAS < prev    next >
Pascal/Delphi Source File  |  1991-01-31  |  1KB  |  45 lines

  1. {$A+,B-,D+,E-,F-,I-,L-,N-,O-,R-,S-,V-}
  2. {$M 16384,0,655360}
  3.  
  4. Program PackFile;
  5.  
  6. Uses Crt,TPDB,TPDBScrn,TPDBStr;
  7.  
  8. Var
  9.    Message : String[80];
  10.         RecCount : string;
  11.         Packer : DataObject;
  12.  
  13. begin
  14.      CursorOff;
  15.      If ParamCount = 0 then
  16.      begin
  17.           Beep;
  18.           ClrScr;
  19.           Flash(1,1,LightGreen+BlackBG,'PACK filename.dbf');
  20.           CursorOn;
  21.           Halt(1);
  22.      end;
  23.           NEW(Packer,Init(ParamStr(1)));
  24.           If Packer^.TotalRecs = 0 then
  25.      begin
  26.           ClrScr;
  27.           Beep;
  28.           Message := 'Record count in file '+Upper(ParamStr(1))+' is ZERO.';
  29.           Flash(1,1,LightGreen+BlackBG,Message);
  30.           CursorOn;
  31.           Halt(1);
  32.      end;
  33.      ClrScr;
  34.      Message := 'PACKing file '+Upper(ParamStr(1));
  35.      FlashC(11,Yellow+BlackBG,Message);
  36.           Packer^.Pack;
  37.           Str(Packer^.TotalRecs:10,RecCount);
  38.      FlashC(12,LightGreen+BlackBG,'File has been packed.');
  39.      Message := 'Current record count in file '+Upper(ParamStr(1))+' is '+LTrim(RecCount);
  40.      FlashC(13,LightCyan+BlackBG,Message);
  41.      FlashC(14,White+BlackBG,'Copyright 1991 Brian Corll');
  42.           DISPOSE(Packer,Done);
  43.           CursorOn;
  44. end.
  45.